import React, { useState } from 'react'
import { Popup, Button, List } from 'antd-mobile'
// import { DemoBlock, lorem } from 'demos'
import { useNavigate } from "react-router-dom"

import { useSelector, useDispatch } from 'react-redux'
import { hide } from '../../store/modules/counterSlice'
import "./aside.scss"
function Aside() {
    const visible3 = useSelector(state => state.counter.show)
    const dispatch = useDispatch()
    const navigate = useNavigate()
    function handleClick(path) {
        dispatch(hide())
        navigate(path);
    }
    return (
        <>
            <Popup
                mask={false}
                visible={visible3}

                position='left'
            >

                <List mode='card'>
                    <List.Item onClick={() => { handleClick("/") }}>首页</List.Item>
                    <List.Item onClick={() => { handleClick("/getmoney") }}>提现</List.Item>
                    <List.Item onClick={() => { handleClick("/help") }}>帮助中心</List.Item>
                </List>

            </Popup>
        </>
    )

}

export default Aside